package com.bajiao.mapper.system;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bajiao.common.system.entity.SysDictItem;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @Author zhangweijian
 * @since 2018-12-28
 */
public interface SysDictItemMapper extends BaseMapper<SysDictItem> {

    @Select("SELECT * FROM sys_dict_item WHERE DICT_ID = #{mainId} order by sort_order asc, item_value asc")
    public List<SysDictItem> selectItemsByMainId(String mainId);

    /**
     * 通过字典code 和 字典项的值获取字典项数据
     * @param dictCode
     * @param itemValue
     * @return
     */
    SysDictItem queryDictItemByCodeAndValue(@Param("dictCode") String dictCode, @Param("itemValue") String itemValue);


    /**
     * 通过字典code 和 字典项的值获取字典项数据
     * @param dictCode
     * @param itemValues
     * @return
     */
    List<SysDictItem> queryDictItemByCodeAndValues(@Param("dictCode") String dictCode, @Param("itemValues") String itemValues);

}
